<!DOCTYPE html>
<html>
<head>
    <title>Thread Status</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            setInterval(function(){
                $.ajax({
                    url: '/get_thread_status',
                    type: 'GET',
                    dataType: 'json',
                    success: function(data) {
                        var html = '';
                        for(var i = 0; i < data.length; i++) {
                            html += '<tr><td>' + data[i][0] + '</td><td>' + data[i][1] + '</td><td>' + data[i][2] + '</td><td>' + data[i][3] + '</td><td>' + data[i][4] + '</td></tr>';
                        }
                        $('#thread_status').html(html);
                    }
                });
            }, 2000); // 每2秒更新一次
        });
    </script>
</head>
<body>
    <h1>Thread Status</h1>
    <table border="1">
        <thead>
            <tr>
                <th>ID</th>
                <th>Thread Name</th>
                <th>Start Time</th>
                <th>End Time</th>
                <th>Status</th>
            </tr>
        </thead>
        <tbody id="thread_status">
        </tbody>
    </table>
</body>
</html>
